package com.duowei.diandan.util;

import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;

import com.duowei.diandan.R;
import com.duowei.diandan.app.App;

import java.util.Random;

public class ImageRes {
    private static int[] menuHeaderImages = {
            R.drawable.ic_001_grape,
            R.drawable.ic_002_orange,
            R.drawable.ic_003_apple,
            R.drawable.ic_004_pear,
            R.drawable.ic_005_vinegar,
            R.drawable.ic_006_pizza,
            R.drawable.ic_007_rice_1,
            R.drawable.ic_008_soft_drink,
            R.drawable.ic_009_squid,
            R.drawable.ic_010_croissant
    };


    private static int[] bgItemImages = {
            R.drawable.ic_040_garlic,
            R.drawable.ic_041_potato,
            R.drawable.ic_042_cabbage,
            R.drawable.ic_043_avocado,
            R.drawable.ic_044_tomato,
            R.drawable.ic_045_onion,
            R.drawable.ic_046_carrot,
            R.drawable.ic_047_pepper,
            R.drawable.ic_048_pumpkin,
            R.drawable.ic_049_cherry,
            R.drawable.ic_050_egg,
            R.drawable.ic_040_garlic,
    };

    public static int getMenuHeaderImage() {
        int rand = new Random(System.currentTimeMillis()).nextInt(menuHeaderImages.length);
        return menuHeaderImages[rand];
    }

    public static Drawable getMenuHeaderDrawable() {
        int rand = new Random(System.currentTimeMillis()).nextInt(menuHeaderImages.length);
        return ContextCompat.getDrawable(App.getApp(), menuHeaderImages[rand]);
    }

    public static int getBgItemImage() {
        int rand = new Random(System.currentTimeMillis()).nextInt(bgItemImages.length);
        return bgItemImages[rand];
    }
}
